using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class TreatmentPlanMap : EntityTypeConfiguration<TreatmentPlan>
    {
        public TreatmentPlanMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Description)
                .HasMaxLength(50);

            this.Property(t => t.Physician)
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.PaymentTerms)
                .HasMaxLength(50);

            this.Property(t => t.Order_)
                .HasMaxLength(15);

            // Table & Column Mappings
            this.ToTable("TreatmentPlan");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.Notes).HasColumnName("Notes");
            this.Property(t => t.EstimatedCharges).HasColumnName("EstimatedCharges");
            this.Property(t => t.StartDate).HasColumnName("StartDate");
            this.Property(t => t.Physician).HasColumnName("Physician");
            this.Property(t => t.PatientIID).HasColumnName("PatientIID");
            this.Property(t => t.PaymentTerms).HasColumnName("PaymentTerms");
            this.Property(t => t.Completed).HasColumnName("Completed");
            this.Property(t => t.diagnosis).HasColumnName("diagnosis");
            this.Property(t => t.PriceList).HasColumnName("PriceList");
            this.Property(t => t.DiscPerc).HasColumnName("DiscPerc");
            this.Property(t => t.DentalLabChart).HasColumnName("DentalLabChart");
            this.Property(t => t.A_TR1).HasColumnName("A_TR1");
            this.Property(t => t.A_TR2).HasColumnName("A_TR2");
            this.Property(t => t.A_TR3).HasColumnName("A_TR3");
            this.Property(t => t.A_TR4).HasColumnName("A_TR4");
            this.Property(t => t.A_TR5).HasColumnName("A_TR5");
            this.Property(t => t.A_TR6).HasColumnName("A_TR6");
            this.Property(t => t.A_TR7).HasColumnName("A_TR7");
            this.Property(t => t.A_TR8).HasColumnName("A_TR8");
            this.Property(t => t.B_TR1).HasColumnName("B_TR1");
            this.Property(t => t.B_TR2).HasColumnName("B_TR2");
            this.Property(t => t.B_TR3).HasColumnName("B_TR3");
            this.Property(t => t.B_TR4).HasColumnName("B_TR4");
            this.Property(t => t.B_TR5).HasColumnName("B_TR5");
            this.Property(t => t.B_TR6).HasColumnName("B_TR6");
            this.Property(t => t.B_TR7).HasColumnName("B_TR7");
            this.Property(t => t.B_TR8).HasColumnName("B_TR8");
            this.Property(t => t.C_TR1).HasColumnName("C_TR1");
            this.Property(t => t.C_TR2).HasColumnName("C_TR2");
            this.Property(t => t.C_TR3).HasColumnName("C_TR3");
            this.Property(t => t.C_TR4).HasColumnName("C_TR4");
            this.Property(t => t.C_TR5).HasColumnName("C_TR5");
            this.Property(t => t.C_TR6).HasColumnName("C_TR6");
            this.Property(t => t.C_TR7).HasColumnName("C_TR7");
            this.Property(t => t.C_TR8).HasColumnName("C_TR8");
            this.Property(t => t.D_TR1).HasColumnName("D_TR1");
            this.Property(t => t.D_TR2).HasColumnName("D_TR2");
            this.Property(t => t.D_TR3).HasColumnName("D_TR3");
            this.Property(t => t.D_TR4).HasColumnName("D_TR4");
            this.Property(t => t.D_TR5).HasColumnName("D_TR5");
            this.Property(t => t.D_TR6).HasColumnName("D_TR6");
            this.Property(t => t.D_TR7).HasColumnName("D_TR7");
            this.Property(t => t.D_TR8).HasColumnName("D_TR8");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.Technician).HasColumnName("Technician");
            this.Property(t => t.Appliance).HasColumnName("Appliance");
            this.Property(t => t.Worktype).HasColumnName("Worktype");
            this.Property(t => t.EndDate).HasColumnName("EndDate");
            this.Property(t => t.OrderDate).HasColumnName("OrderDate");
            this.Property(t => t.Started).HasColumnName("Started");
            this.Property(t => t.Referral).HasColumnName("Referral");
            this.Property(t => t.ImpDate).HasColumnName("ImpDate");
            this.Property(t => t.Shade).HasColumnName("Shade");
            this.Property(t => t.Facility).HasColumnName("Facility");
            this.Property(t => t.Delivered).HasColumnName("Delivered");
            this.Property(t => t.DeliveryDate).HasColumnName("DeliveryDate");
            this.Property(t => t.Order_).HasColumnName("Order#");
            this.Property(t => t.TP_Closed).HasColumnName("TP_Closed");
            this.Property(t => t.TP_ChargesAccepted).HasColumnName("TP_ChargesAccepted");
        }
    }
}
